# !/usr/bin/env python
# -*- coding: utf-8 -*-

import multiprocessing
import time


def worker(name):
    print(f"Worker {name} is starting.")
    time.sleep(2)
    print(f"Worker {name} is exiting.")


def demo1():
    p1 = multiprocessing.Process(target=worker, args=("A",))
    p2 = multiprocessing.Process(target=worker, args=("B",))
    p1.start()
    p2.start()
    p1.join()
    p2.join()


if __name__ == "__main__":
    demo1()
